<%@page language="java" pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>


<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>超市订单管理系统</title>
    <link type="text/css" rel="stylesheet" href="css/style.css" />
    <link type="text/css" rel="stylesheet" href="css/public.css" />
</head>
<body>
<div class="location">
    <strong>你现在所在的位置是:</strong>
    <span>供应商管理页面 >> 供应商修改页</span>
</div>
<div class="providerAdd">
    <form id="providerForm" name="providerForm" method="post" action="jsp/provider.do">
        <!--div的class 为error是验证错误，ok是验证成功-->
        <div class="">
            <label for="idName">供应商编码：</label>
            <input type="text" name="idName" id="idName" value="${providerInfo.idName }" >
        </div>
        <div>
            <label for="name">供应商名称：</label>
            <input type="text" name="name" id="name" value="${providerInfo.providerName }">
            <font color="red"></font>
        </div>

        <div>
            <label for="phoneName">联系人：</label>
            <input type="text" name="phoneName" id="phoneName" value="${providerInfo.phoneName }">
            <font color="red"></font>
        </div>

        <div>
            <label for="phone">联系电话：</label>
            <input type="text" name="phone" id="phone" value="${providerInfo.phone }">
            <font color="red"></font>
        </div>
        <div>
            <label for="fax">传真：</label>
            <input type="text" name="fax" id="fax" value="${providerInfo.fax }">
        </div>
        <div class="providerAddBtn">
            <input type="button" name="save" id="save" value="保存">
            <input type="button" name="reset" id="reset" value="重置">
            <input type="button" id="back" name="back" value="返回" >
        </div>
    </form>
</div>

<footer class="footer">
    版权归北大青鸟
</footer>
</body>

<!-- 保存当前页的后台路径和参数 -->
<c:set var="urlLoading" value="/provider/unique" scope="session"></c:set>
<c:set var="paramLoading" value="id=${providerInfo.id }&page=providerUpdate.jsp" scope="session"></c:set>

<script type="text/javascript">
$(".providerAddBtn :button[value='保存']").bind("click", function() {
	
	if(!confirm("确定保存吗?")) return;
	
	toJump("/provider/modify",
			$("#providerForm").serialize()+"&id=${providerInfo.id}", "#mainframe");
});
$(".providerAddBtn :button[value='返回']").bind("click", function() {
	toJump("${pageContext.request.contextPath}/provider/query", 
			"curr=${paProvider.curr}", "#mainframe");
});
$(".providerAddBtn :button[value='重置']").bind("click", function() {
	$("#providerForm [name='idName']").val("${providerInfo.idName}");
	$("#providerForm [name='name']").val("${providerInfo.providerName}");
	$("#providerForm [name='phoneName']").val("${providerInfo.phoneName}");
	$("#providerForm [name='phone']").val("${providerInfo.phone}");
	$("#providerForm [name='fax']").val("${providerInfo.fax}");
});
</script>
</html>
